import Taro from '@tarojs/taro';
import React from 'react';
import ChooseImageView from './choose-image-view'
import emptyImg from '@/assets/image/none/Empty.png';

export default class imageUpload extends React.Component<any, any> {
  constructor(props) {
    super(props);
    this.state = {
      files: [
        {
          url: emptyImg,
          isDefault: true,
        },
        {
          url: emptyImg,
        },
      ]
    };
  }

  render() {
    return (
      <>
        <ChooseImageView files={this.state.files} maxCount="5" onFileChange={this.onFileChange.bind(this)} />
      </>
    );
  }
  onFileChange = (files) => {
    this.setState(
      {
        files,
      },
      () => {
        console.log(this.state.files);
      },
    );
  };
}
